<!-- 购物卡结佣管理-购物卡结佣-结佣记录-->
<template>
  <div class="shoppingCardSettlementRecord">
    <el-breadcrumb separator="/" class="bread-title">
      <el-breadcrumb-item :to="{ path: '/shoppingCardSettlement' }">购物卡结佣</el-breadcrumb-item>
      <el-breadcrumb-item>结佣记录</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="order">
      <span>
        <b>结算单id:</b>{{brokerApply.batchCode}}
      </span>
    </div>
    <commission :brokerApply="brokerApply" :awardInfoList="awardInfoList"></commission>
    <div class="textTitle">
      <span>结佣记录：</span>
    </div>
    <el-table :data="settleRecordList" border style="width: 100%">
      <el-table-column align="center" prop="settleStatus" label="结佣状态">
        <template slot-scope="scope">
          <span>{{settleStatus(scope.row.settleStatus)}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="settleDesc" label="备注"></el-table-column>
      <el-table-column align="center" prop="operateName" label="操作人"></el-table-column>
      <el-table-column align="center" prop="operateTime" label="操作时间">
        <template slot-scope="scope">{{scope.row.operateTime | formatTime}}</template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script type="text/ecmascript-6">
import api from '@/api/apiPath'
import commission from '../../common/xkCommission'
import utils from "@/common/utils.js";

export default {
  name: "shoppingCardSettlementRecord",
  components: {
    commission
  },
  data() {
    return {
      gridData: [],
      brokerApply: {},
      awardInfoList: [],
      settleRecordList: []
    };
  },
  created() {
      this.list()
  },
  filters: {
    formatTime(time) {
        return utils.getTimeString(time)
    }
  },
  methods: {
    list() {
      let batchCode = this.$route.query.batchCode;
      this.axios.post(api.getSettleCommRecords, { batchCode: batchCode }).then(data => {
        let res = data.data
        if (res.code === 200) {
          this.brokerApply = res.data.brokerApply;
          this.brokerApply.isRecord = true;
          this.awardInfoList = res.data.awardInfoList;
          this.settleRecordList = res.data.settleRecordList;
        }
      })
    },
    settleStatus(status) {
      if(status === 0) {
        return '结佣完成待确认'
      }else if(status === 1) {
        return '结佣失败'
      }else{
        return '结佣成功'
      }
    }
  },
};
</script>
<style lang="stylus" scoped>
.shoppingCardSettlementRecord {
  font-size: 14px;

  .handleA {
    text-decoration: none;
  }

  .order {
    margin-bottom: 25px;
  }

  .textTitle {
    line-height: 40px;
    margin-top: 20px;
  }

  .textSub {
    width: 100%;
    background: #eceaea;
    line-height: 35px;
  }

  table {
    border-collapse: collapse;
    margin: 0 auto;
  }

  table tr td {
    border: 1px solid #ccc;
    line-height: 40px;
    text-align: center;
  }
}
</style>


